package Huihu.src.Duoxiancheng;

public class Saipao {
    public static void main(String[] args) {
        Race race=new Race();
        Thread tz=new Thread(race,"兔子");
        Thread wg=new Thread(race,"乌龟");
        tz.setPriority(Thread.MIN_PRIORITY);
        wg.setPriority(Thread.MAX_PRIORITY);
        tz.start();
        wg.start();

    }
}

class Race implements Runnable{
    @Override
    public void run() {
        for (int length = 0; length <= 100; length+=10) {
            System.out.println(Thread.currentThread().getName()+"跑了"+length+"米");
        }
        }
    }
